<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件
/**
 * @param null $userinfo
 * @return mixed 后台登录信息保存
 */
error_reporting(E_ERROR | E_WARNING | E_PARSE);
function logins($userinfo = null)
{
    if ($userinfo) {
        session('USERINFOS', $userinfo);
    } else {
        return session('USERINFOS');
    }
}

/*
 * 判断用户是否登陆
 */
function isLogins(){
    return logins();
}

/**
 * 将session中的用户信息请求
 */
function logout()
{
    session('USERINFOS', null);
//    session('USERINFOS', null);
//    session('PERMISSIONURL', null);
//    session('PERMISSIONID', null);
//    cookie('admin_id', null);
//    cookie('auto_key', null);
}